<img src='partials/TestDataXY_Math.PNG' style='width:400px;float:right'>
<div>
<pre>
<span class='code_snippet' style='font-size: 11px'>

ArrayList&lt;XYDataSeries&gt; xySeriesList = new ArrayList&lt;XYDataSeries&gt;();

ArrayList&lt;DataPoint&gt; values = new ArrayList&lt;DataPoint&gt;();

for (int i = -10; i &lt; 10; i++) {
values.add(new DataPoint(i, i * i));
}

ArrayList&lt;DataPoint&gt; values3 = new ArrayList&lt;DataPoint&gt;();
for (int i = -5; i &lt; 5; i++) {

double x = Math.exp(i);

values3.add(new DataPoint(i, x));
}

XYDataSeries series = new XYDataSeries(new UIPointSquare(Color.BLUE),
new Line(Color.BLUE), "x^2");
series.dataPoints = values;

XYDataSeries series3 = new XYDataSeries(

new UIPointTriangle(Color.PINK), new Line(Color.PINK), "e^x");

series3.dataPoints = values3;

NumericalInterval t1x = new NumericalInterval(6, 10.0, new Line(
Color.GRAY, false, 1));
NumericalInterval t2x = new NumericalInterval(3, 5.0, new Line(
Color.LIGHT_GRAY, true, 1));
NumericalInterval t3x = new NumericalInterval(1, 1.0, new Line(
Color.LIGHT_GRAY, true, 1));

YAxis yAxis = new YAxis(new LinearNumericalAxisScaling(-10.0, 10.0,
t1x, t2x, t3x), "Y Axis");

XAxis xAxis = new XAxis(new LinearNumericalAxisScaling(-10.0, 10.0,
t1x, t2x, t3x), "X Value");

xySeriesList.add(series);
xySeriesList.add(series3);

XYChart chart = new XYChart("","","", xySeriesList, yAxis, xAxis, false);

chart.setSize(1000, 500);
chart.rightOffset = 200;

chart.setTitleFont(new Font("Ariel", Font.PLAIN, 24));
chart.setTitle("Maths");

</span></pre></div>